package com.winit.tree.model;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "matrix_tree")
@DynamicUpdate
@DynamicInsert
public class TreeNode implements Serializable {
    @Column(name = "id")
    @Id
    private String id;  //业务线id
    @Column(name = "name")
    private String name;    // 业务线名称
    @Column(name = "level")
    private String level;    // 级别
    @Column(name = "parent_id")
    private String parentId;    // 上级业务线id
    @Column(name = "is_del")
    private String isDel;    // 整条数据是否被删除  0 是 1 否
    @Column
    private String type;    //PRODUCT_LINE
    @Column(name = "childsort")
    private String childsort;
    @Transient
    private List<TreeNode> children;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getIsDel() {
        return isDel;
    }

    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getChildsort() {
        return childsort;
    }

    public void setChildsort(String childsort) {
        this.childsort = childsort;
    }
}
